# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-clamd
pkgname=('python2-clamd' 'python-clamd')
_pkgname=clamd
pkgver=1.0.2
pkgrel=10
pkgdesc='A python interface to Clamd (an anti-virus engine).'
arch=('any')
url='https://pypi.python.org/pypi/clamd'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b025d502cacff138e8a4f8d8bab2105e0f7cba2e95b410e40010842c6614fbee0dce84acb996f91fd7eeb9aac838b5f84f8831ee1ff92c9cfb5aabe9414baf83')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python2 setup.py build
}

package_python2-clamd() {
  depends=('python2' 'python2-nose' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-clamd() {
  depends=('python' 'python-nose' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

